home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Source.bin / DaySpinner.java < prev    next >
Text File  |  1998-08-21  |  1KB  |  44 lines

  1. package symantec.itools.awt.util.spinner;
  2.  
  3. //  08/28/97    LAB    Updated version to 1.1.  Made it get list of days from java localization
  4. //                    support (Addresses Mac Bug #7371).
  5. //  08/29/97    CAR constructor now sets max to index 6
  6.  
  7. /**
  8.  * Day of the week spin control.<br>
  9.  * Creates a text box, containing a list of the days of the week,
  10.  * with up and down arrows. Allows your user
  11.  * to move through a set of fixed values or type a valid value in the box.
  12.  *
  13.  * @see ListSpinner
  14.  *
  15.  * @version 1.1, August 28, 1997
  16.  *
  17.  * @author    Symantec
  18.  *
  19.  */
  20. public class DaySpinner extends ListSpinner
  21. {
  22.     /**
  23.      * Construct DaySpinner component.  This component includes
  24.      * the weekdays in the order Sunday through Saturday.  By default,
  25.      * the inial display of this component is the item "Sunday".
  26.      */
  27.  
  28.     public DaySpinner()
  29.     {
  30.         java.text.DateFormatSymbols dfs = new java.text.DateFormatSymbols();
  31.         String days[] = dfs.getWeekdays();
  32.         int length = days.length ;
  33.  
  34.         //??? LAB ??? The first item is blank, why?
  35.         int i = days[0].equals("") ? 1 : 0;
  36.         for(; i < length; ++i)
  37.             addItem(days[i]);
  38.  
  39.         try {
  40.             setMax(6);
  41.         } catch (java.beans.PropertyVetoException e) {}
  42.     }
  43. }
  44.